<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $this->systemName;?></title>
<link rel="stylesheet" href="<?php echo $this->baseUrl;?>/files/admin/css/main.css" />
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/jquery.js"></script>
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/load.js"></script>
</head>

<body>
	<div id="main">
		<div id="navigation">当前位置：<a href="<?php echo $this->projectUrl(array('action'=>'index'));?>">菜单列表</a> &gt; <span id="focus">添加“<?php echo !empty($this->parentRow) ? $this->parentRow['name'] : '顶级';?>”菜单</span></div>
		<div id="body">
			<div id="edit">
				<form id="editForm" name="editForm" method="post" action="">
					<table class="table">
						<tr>
							<td>行</td>
							<td>名称</td>
							<td>链接</td>
							<td>模块 </td>
							<td>控制器</td>
							<td>动作</td>
							<td class="dataLine">其他查询字符</td>
							<td>可显？</td>
							<td>可用？</td>
							<td>类型</td>
							<td>排序（小到大）</td>
							<td>说明</td>
							<td>说明文档（格式为：name.docx）</td>
						</tr>
<?php
for($i = 0; $i <= 9; $i++) {
?>
						<tr class="dataLine">
							<td><?php echo ($i + 1);?></td>
							<td><input name="name<?php echo $i;?>" type="text" class="input" id="name<?php echo $i;?>" value="" size="10"/></td>
							<td><input name="isLink<?php echo $i;?>" type="checkbox" id="isLink<?php echo $i;?>" checked="checked" value="1" /></td>
							<td><input name="module<?php echo $i;?>" type="text" class="input" id="module<?php echo $i;?>" value="admin" size="10"/></td>
							<td><input name="controller<?php echo $i;?>" type="text" class="input" id="controller<?php echo $i;?>" value="" size="10"/></td>
							<td><input name="action<?php echo $i;?>" type="text" class="input" id="action<?php echo $i;?>" value="" size="10"/></td>
							<td><input name="otherQueryString<?php echo $i;?>" type="text" class="input" id="otherQueryString<?php echo $i;?>" value="" size="15"/></td>
							<td><input name="isDisplay<?php echo $i;?>" type="checkbox" id="isDisplay<?php echo $i;?>" value="1" checked="checked" /></td>
							<td><input name="status<?php echo $i;?>" type="checkbox" id="status<?php echo $i;?>" checked="checked" value="1" /></td>
							<td><select name="type<?php echo $i;?>" id="type<?php echo $i;?>">
								<option value="1" selected="selected">产品</option>
								<option value="2">非产品</option>
							</select>							</td>
							<td><input name="sort<?php echo $i;?>" type="text" class="input checkInt" id="sort<?php echo $i;?>" value="<?php echo ($i + 1)?>" default="<?php echo ($i + 1)?>" size="5" /></td>
							<td><input name="notes<?php echo $i;?>" type="text" class="input" id="notes<?php echo $i;?>" value="" size="30" /></td>
							<td><input name="helpUrl<?php echo $i;?>" type="text" class="input" id="helpUrl<?php echo $i;?>" value="" size="30" /></td>
						</tr>
<script language="javascript">
$("#isLink<?php echo $i;?>").click(
	function ()
	{
		isLinkSet(this.checked, '<?php echo $i;?>');
	}
);
$(document).ready(function(){
	isLinkSet(this.checked, '<?php echo $i;?>');
});
</script>
<?php
}
?>
						<tr>
							<td colspan="13"><input type="submit" name="button" id="button" value="提交" class="button" /> 
								注：如果不添加，请设置名称为空。</td>
						</tr>
					</table>
				  <input type="hidden" name="dataNum" id="dataNum" value="<?php echo $i;?>"/>
				</form>
			</div>
		</div>
</div>
<script language="javascript">
function isLinkSet(checked, key)
{
	if (checked == false) {
		$("#module" + key).val('');
		$("#module" + key).attr('disabled', true);
		$("#controller" + key).val('');
		$("#controller" + key).attr('disabled', true);
		$("#action" + key).val('');
		$("#action" + key).attr('disabled', true);
		$("#otherQueryString" + key).val('');
		$("#otherQueryString" + key).attr('disabled', true);
	} else {
		$("#module" + key).attr('disabled', false);
		$("#controller" + key).attr('disabled', false);
		$("#action" + key).attr('disabled', false);
		$("#otherQueryString" + key).attr('disabled', false);
	}
	
}
</script>
</body>
</html>